<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <!-- 创建点击按钮 -->
    <button class="but">打开页面</button>
    <script>
        /* 获取点击按钮，并声明点击按钮 */
        document.getElementsByClassName("but")[0].onclick = function() {
            window.open("./a.html"); /* 跳转a页面 */
        };
    </script>
</body>

</html>